package org.blueoxygen.kukuruyuk.actions.address;
import java.util.ArrayList;
import java.util.List;

import org.blueoxygen.cimande.gx.entity.GxDroplistValue;
import org.blueoxygen.cimande.persistence.PersistenceAware;
import org.blueoxygen.cimande.persistence.PersistenceManager;
import org.blueoxygen.cimande.security.SessionCredentials;
import org.blueoxygen.cimande.security.SessionCredentialsAware;
import org.blueoxygen.kukuruyuk.entity.Address;
import com.opensymphony.xwork2.ActionSupport;

public class AddressForm extends ActionSupport
implements PersistenceAware, SessionCredentialsAware {

protected PersistenceManager manager;
protected SessionCredentials sessionCredentials;
private String dropList;
private Address Address = new Address();
private List<Address> Addresss = new ArrayList<Address>();

private GxDroplistValue droplistValue = new GxDroplistValue();
private List<GxDroplistValue> droplistValues = new ArrayList<GxDroplistValue>();

public String execute(){
		if(getAddress().getId() != null &&
			!"".equalsIgnoreCase(getAddress().getId().trim())){
			setAddress((Address) manager.getById(Address.class, getAddress().getId()));
		}
		setDroplistValues(manager.getList("SELECT w FROM "+GxDroplistValue.class.getName()+" w WHERE w.name.id='8a8a8a941f59f569011f59f6372c0001'", null,null));
			return SUCCESS;
		}
	public void setPersistenceManager(PersistenceManager persistenceManager){
		this.manager = persistenceManager;
	}
	public void setSessionCredentials(SessionCredentials sessionCredentials){
		this. sessionCredentials = sessionCredentials;
	}
	public Address getAddress() {
		return Address;
	}
	public void setAddress(Address Address) {
		this.Address = Address;
	}
	public List<Address> getAddresss() {
		return Addresss;
	}
	public void setAddresss(List<Address> Addresss) {
		this.Addresss = Addresss;
	}
	public GxDroplistValue getDroplistValue() {
		return droplistValue;
	}
	public void setDroplistValue(GxDroplistValue droplistValue) {
		this.droplistValue = droplistValue;
	}
	public List<GxDroplistValue> getDroplistValues() {
		return droplistValues;
	}
	public void setDroplistValues(List<GxDroplistValue> droplistValues) {
		this.droplistValues = droplistValues;
	}
	public String getDropList() {
		return dropList;
	}
	public void setDropList(String dropList) {
		this.dropList = dropList;
	}
	
}